
CLEANFILES = *~
DISTCLEANFILES = *~

bin_PROGRAMS = ms2lstat lstatfit lstatpop lstatarr lstatslg lstatist

ECMLIB = -lECM

CLX_HOME ?= @prefix@
CLX_HOME_INC = $(CLX_HOME)/include
CLX_HOME_LIB = $(CLX_HOME)/lib

ms2lstat_SOURCES = ms2lstat.c ms2lstat.h lparser.c ms2lstat_mod.c ms2lstat_mod.h \
	ms2lstat_media.c ms2lstat_client.c ms2lstat_player.c ms2lstat_session.c ms2lstat_arrival.c \
	ms2lstat_req.c ms2lstat_util.c lstatconf.c \
	ms2lstat_log.c ms2lstat_dbg.c

LSTATFIT = lstatfit_exponential.c lstatfit_beta.c lstatfit_lognormal.c lstatfit_weibull.c lstatfit_common.c lstatfit.h

lstatfit_SOURCES = lstatfit.c lstatfit_read.c $(LSTATFIT)
lstatpop_SOURCES = lstatpop.c
lstatarr_SOURCES = lstatarr.c $(LSTATFIT) 
lstatslg_SOURCES = lstatslg.c $(LSTATFIT)
lstatist_SOURCES = lstatist.c $(LSTATFIT)

INCLUDES = -I$(CLX_HOME_INC) -I../../lib

ms2lstat_LDFLAGS = -L$(CLX_HOME_LIB) -L/usr/lib64/disksim -static -dlopen self 

# RHEL6 requires -lgslcblas
ms2lstat_LDADD = ../../lib/libms2sim.la $(ECMLIB) # -lgsl -lgslcblas -ldisksim -ldiskmodel -lmemsmodel -lparam -lddbg

lstatfit_LDFLAGS = -L$(CLX_HOME_LIB) -static
lstatfit_LDADD = $(ECMLIB) -lgsl -lgslcblas -lm

lstatpop_LDFLAGS = -L$(CLX_HOME_LIB) -static
lstatpop_LDADD = $(ECMLIB) -lgsl -lgslcblas -lm

lstatarr_LDFLAGS = -L$(CLX_HOME_LIB) -static
lstatarr_LDADD = $(ECMLIB) -lgsl -lgslcblas -lm

lstatslg_LDFLAGS = -L$(CLX_HOME_LIB) -static
lstatslg_LDADD = $(ECMLIB) -lgsl -lgslcblas -lm

lstatist_LDFLAGS = -L$(CLX_HOME_LIB) -static
lstatist_LDADD = $(ECMLIB) -lgsl -lgslcblas -lm